import { createApp } from 'vue'
import { createPinia } from 'pinia'
import http from './config/axios.config'
import App from './App.vue'
import router from './router'
import './assets/scss/main.scss'
import './assets/scss/usemain.scss'
import 'animate.css'
//引入样式
import 'highlight.js/styles/base16/dracula.css'
//引入库
import  hljs from 'highlight.js'
const app = createApp(App)
declare module 'vue' {
    export interface ComponentCustomProperties {
        $axios: typeof http
    }
}
app.config.globalProperties.$axios = http
app.directive('highlight', function (el) {
    const blocks = el.querySelectorAll('pre code');
    hljs.configure({
        ignoreUnescapedHTML:true  //取消xss警告
    })
    blocks.forEach((block: any) => {
        hljs.highlightBlock(block)
    })
})
app.use(createPinia())
app.use(router)

app.mount('#app')
